package company;
import java.util.Scanner;
//散列的联系
public class suanfa {
    public static void main() {
        Scanner stdin=new Scanner(System.in);
    int maxn = 100010;
    boolean []hashTable=new boolean[maxn];
    int n,m,x;
    n=stdin.nextInt();
    m=stdin.nextInt();
    for(int i=0;i<n;i++)
    {
        x=stdin.nextInt();
        hashTable[x]=true;
    }
    for(int i=0;i<m;i++)
    {
        x=stdin.nextInt();
        if(hashTable[x]==true)
        {
            System.out.println("存在");
            System.out.println(x);
        }
        else
        {
            System.out.println("不存在");
        }
    }
    }
}
